@extends('admin.layout.layout', ['row' => @$page])

@section('contain')


    <div class="portlet">
        <div class="portlet-title">
            <div class="caption">
                <x-portlet-breadcrumb :page="$page"></x-portlet-breadcrumb>
            </div>
            <div class="actions"></div>
        </div>

        <div>
            @empty($upload_error)
                <table class="table table-s2 text-center">
                    <thead>
                    <tr>
                        <th>{{ ts('sequence') }}</th>
                        <th>{{ ts('warrantyid') }}</th>
                        <th>{{ ts('CAROWNERNAME') }}</th>
                        <th>{{ ts('CONTACTINFORMATION') }}</th>
                        <th>{{ ts('rollnumber') }}</th>
                        <th>{{ ts('changdu') }}</th>
                        <th>{{ ts('ZTMD') }}</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($data as $k => $v)
                        <tr>
                            <td>{{ $k + 1 }}</td>
                            <td>{{ @$v['warranty']['id'] }}</td>
                            <td>{{ @$v['warranty']['first_name'] }}</td>
                            <td>{{ @$v['warranty']['phone_number'] }}</td>
                            <td>{{ @$v['coverage']['roll_number'] }}</td>
                            <td>{{ @$v['coverage']['length'] }}</td>
                            <td>{{ @$users[$v['warranty']['user_id']] }}</td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
            @else

                @foreach($upload_error as $v)
                    <div class="alert alert-warning my-3">{{ $v }}</div>
                @endforeach
            @endif
                <div class="my-3 p-3">
                    <a href="/admin/old-warranty/import/" class="btn btn-primary">{{ ts('CONFIRM') }}</a>
                </div>
        </div>

    </div>


@endsection